package com.it.travel.controller.admin;

import com.it.travel.service.admin.AdminOrderService;
import com.it.travel.vo.Params.PageParams;
import com.it.travel.vo.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/admin/order")
@CrossOrigin
public class AdminOrderController {

    @Resource
    private AdminOrderService adminOrderService;

    @GetMapping("")
    public Result<?> getInfoPage(PageParams pageParams) {
        System.out.println("pageParams = " + pageParams);
        Result<?> result = adminOrderService.getInfoPage(pageParams);
        return result;
//        return null;
    }

    @PutMapping("")
    public Result<?> updateOrderStatus(Integer id) {
        Result<?> result = adminOrderService.updateOrderStatus(id);
        return result;
    }
}
